package demo2;

public class TestDemo {


    public void method3(){
        synchronized(this){
            //对当前对象加锁
        }
    }

    public void method4(){
        synchronized(TestDemo.class){
            //对类对象加锁
        }
    }



    public static void main(String[] args) {

    }

}
